﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;

namespace FormLib.Forms
{
    public partial class MonitoringMethodFrom : DevExpress.XtraEditors.XtraForm
    {
        private BindingList<ObjectWithNameAndDetail> data1 = new BindingList<ObjectWithNameAndDetail>();
        public MonitoringMethodFrom()
        {
            InitializeComponent();
        }

        private void MonitoringMethodFrom_Load(object sender, EventArgs e)
        {
                string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\datasource.accdb";
            OleDbDataAdapter oda = new OleDbDataAdapter("select * from 监测方法", connString);
            DataSet ds = new DataSet();
            oda.Fill(ds);
            gridControl1.DataSource = ds.Tables[0];
        }
        private void processData()
        {
            ObjectWithNameAndDetail o = new ObjectWithNameAndDetail();
            o.name = "三波长红外法（GB/T16488-1996）";
            o.labMonitoring = "有毒气体泄漏";
            o.sceneMonitoring = "";
            data1.Add(o);
            o = new ObjectWithNameAndDetail();
            o.name = "测试方法1";
            o.labMonitoring = "有毒气体泄漏";
            o.sceneMonitoring = "";
            data1.Add(o);
            o = new ObjectWithNameAndDetail();
            o.name = "测试方法2";
            o.labMonitoring = "有毒气体泄漏";
            o.sceneMonitoring = "";
            data1.Add(o);
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //var result = (from x in data1
            //              where (x.name like '') 
            //              select new ObjectWithNameAndDetail
            //              {
            //                  name = x.name,
            //                  type = x.type,
            //                  detail = x.detail
            //              }).ToList();
            //return new BindingList<MyObject>(result);
        }
    }
}